package com.cmower.baeldung.string1;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class StringMutiLine {
    public static void main(String[] args) throws IOException {
        String newLine = System.getProperty("line.separator");
        String mutiLine = "亲爱的"
                .concat(newLine)
                .concat("我想你了")
                .concat(newLine)
                .concat("你呢？")
                .concat(newLine)
                .concat("有没有在想我呢？");

        String mutiLine1 = "亲爱的"
                + newLine
                + "你好幼稚啊"
                + newLine
                + "技术文章里"
                + newLine
                + "你写这些合适吗";

        String mutiLine2 = String.join(newLine, "亲爱的", "合适啊", "这叫趣味", "哈哈");

String mutiLine3 = new StringBuilder()
        .append("亲爱的")
        .append(newLine)
        .append("看不下去了")
        .append(newLine)
        .append("肉麻")
        .toString();

String mutiLine4 = new String(Files.readAllBytes(Paths.get("src/main/resource/cmower.txt")));
        System.out.println(mutiLine4);
    }
}
